package cn.ibizlab.todo.core.pms.client;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import cn.ibizlab.todo.core.pms.domain.Project;
import cn.ibizlab.todo.core.pms.filter.ProjectSearchContext;
import org.springframework.cloud.openfeign.FeignClient;

/**
 * 实体[Project] 服务对象接口
 */
@FeignClient(value = "${ibiz.ref.service.pms-webapi:pms-webapi}", contextId = "Project", fallback = ProjectFallback.class)
public interface ProjectFeignClient {

    @RequestMapping(method = RequestMethod.GET, value = "/projects/select")
    Page<Project> select();


    @RequestMapping(method = RequestMethod.POST, value = "/projects")
    Project create(@RequestBody Project project);

    @RequestMapping(method = RequestMethod.POST, value = "/projects/batch")
    Boolean createBatch(@RequestBody List<Project> projects);


    @RequestMapping(method = RequestMethod.PUT, value = "/projects/{id}")
    Project update(@PathVariable("id") Long id,@RequestBody Project project);

    @RequestMapping(method = RequestMethod.PUT, value = "/projects/batch")
    Boolean updateBatch(@RequestBody List<Project> projects);


    @RequestMapping(method = RequestMethod.DELETE, value = "/projects/{id}")
    Boolean remove(@PathVariable("id") Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/projects/batch}")
    Boolean removeBatch(@RequestBody Collection<Long> idList);


    @RequestMapping(method = RequestMethod.GET, value = "/projects/{id}")
    Project get(@PathVariable("id") Long id);


    @RequestMapping(method = RequestMethod.GET, value = "/projects/getdraft")
    Project getDraft();


    @RequestMapping(method = RequestMethod.POST, value = "/projects/checkkey")
    Boolean checkKey(@RequestBody Project project);


    @RequestMapping(method = RequestMethod.POST, value = "/projects/{id}/favorites")
    Project favorites(@PathVariable("id") Long id,@RequestBody Project project);


    @RequestMapping(method = RequestMethod.POST, value = "/projects/save")
    Boolean save(@RequestBody Project project);

    @RequestMapping(method = RequestMethod.POST, value = "/projects/savebatch")
    Boolean saveBatch(@RequestBody List<Project> projects);


    @RequestMapping(method = RequestMethod.POST, value = "/projects/{id}/saveproject")
    Project saveProject(@PathVariable("id") Long id,@RequestBody Project project);


    @RequestMapping(method = RequestMethod.POST, value = "/projects/{id}/saveprojectteam")
    Project saveProjectTeam(@PathVariable("id") Long id,@RequestBody Project project);



    @RequestMapping(method = RequestMethod.POST, value = "/projects/searchcuruser")
    Page<Project> searchCurUser(@RequestBody ProjectSearchContext context);



    @RequestMapping(method = RequestMethod.POST, value = "/projects/searchdefault")
    Page<Project> searchDefault(@RequestBody ProjectSearchContext context);


}
